import request from '@/utils/request'
export function HotCourse() {
  return request({
    url: '/eduservice/getHotCourse',
    method: 'get'
  })}

export function AllCourse(params,pageCount) {
  return request({
    url: '/eduservice/getAllCourse/'+pageCount,
    method: 'post',
    data:params
  })
}
export function getAllSubject() {
  return request({
    url: '/subject/getAllSubject',
    method: 'get'
  })
}


export default {
  //条件分页课程查询的方法
  getCourseList(page,limit,searchObj) {
    return request({
      url: `/eduservice/coursefront/getFrontCourseList/${page}/${limit}`,
      method: 'post',
      data: searchObj
    })
  },
  //查询所有分类的方法
  getAllSubject() {
    return request({
      url: '/eduservice/subject/getAllSubject',
      method: 'get'
    })
  },
  //课程详情的方法
  getCourseInfo(id) {
    return request({
      url: '/eduservice/getByIdAll/'+id,
      method: 'get'
    })
  },
  getCourseId(id) {
    return request({
      url: '/eduservice/Course/'+id,
      method: 'post'
    })
  },
  getCha1(id) {
    return request({
      url: '/eduservice/cha1/' + id,
      method: 'post'
    })
  },
  getCha2(id) {
    return request({
      url: '/eduservice/cha2/' + id,
      method: 'post'
    })
  },
  getCha3(id) {
    return request({
      url: '/eduservice/cha3/' + id,
      method: 'post'
    })
  },

  //提交评论方法
  tj(data) {
    console.log(data)
    return request({
      url: '/eduservice/tijiao',
      method: 'post',
      data: data
    })
  }

}
